# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.AndroidEnterprise.V1.Model.KeyedAppState do
  @moduledoc """
  Represents a keyed app state containing a key, timestamp, severity level, optional description, and optional data.

  ## Attributes

  *   `data` (*type:* `String.t`, *default:* `nil`) - Additional field intended for machine-readable data. For example, a number or JSON object. To prevent XSS, we recommend removing any HTML from the data before displaying it.
  *   `key` (*type:* `String.t`, *default:* `nil`) - Key indicating what the app is providing a state for. The content of the key is set by the app's developer. To prevent XSS, we recommend removing any HTML from the key before displaying it. This field will always be present.
  *   `message` (*type:* `String.t`, *default:* `nil`) - Free-form, human-readable message describing the app state. For example, an error message. To prevent XSS, we recommend removing any HTML from the message before displaying it.
  *   `severity` (*type:* `String.t`, *default:* `nil`) - Severity of the app state. This field will always be present.
  *   `stateTimestampMillis` (*type:* `String.t`, *default:* `nil`) - Timestamp of when the app set the state in milliseconds since epoch. This field will always be present.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :data => String.t() | nil,
          :key => String.t() | nil,
          :message => String.t() | nil,
          :severity => String.t() | nil,
          :stateTimestampMillis => String.t() | nil
        }

  field(:data)
  field(:key)
  field(:message)
  field(:severity)
  field(:stateTimestampMillis)
end

defimpl Poison.Decoder, for: GoogleApi.AndroidEnterprise.V1.Model.KeyedAppState do
  def decode(value, options) do
    GoogleApi.AndroidEnterprise.V1.Model.KeyedAppState.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.AndroidEnterprise.V1.Model.KeyedAppState do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
